#! /bin/bash
export LANG=zh_CN.UTF-8
HIVE_HOME=/usr/bin/hive


${HIVE_HOME} -S -e "

--有效线索个数
--数据问题，只采集有效线索个数作为计算使用
DROP TABLE IF EXISTS fac_valid_clue;
CREATE TABLE edu_online_dwd.fac_valid_clue(
    valid_clue_count INT
)COMMENT '有效线索数'
    ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
    STORED AS ORC TBLPROPERTIES ('orc.compress' = 'SNAPPY');

--校区学科维度表
DROP TABLE IF EXISTS dim_campus_subject;
CREATE TABLE edu_online_dwd.dim_campus_subject
(
    id                  INT COMMENT 'ems课程id(非自增)',
    create_date_time    DATE COMMENT '创建时间',
    update_date_time    TIMESTAMP COMMENT '最后更新时间',
    deleted             INT COMMENT '是否被删除（禁用）',
    itcast_school_id    STRING COMMENT 'ems校区ID',
    itcast_school_name  STRING COMMENT 'ems校区名称',
    itcast_subject_id   STRING COMMENT 'ems学科ID',
    itcast_subject_name STRING COMMENT 'ems学科名称',
    itcast_brand        STRING COMMENT 'ems品牌',
    clazz_type_state    STRING COMMENT '班级类型状态',
    clazz_type_name     STRING COMMENT '班级类型名称',
    teaching_mode       STRING COMMENT '授课模式',
    start_time          DATE COMMENT '开班时间',
    end_time            DATE COMMENT '毕业时间',
    comment             STRING COMMENT '备注',
    detail              STRING COMMENT '详情(比如：27期)',
    uncertain           INT COMMENT '待定班(0:否,1:是)',
    dt                  STRING
) COMMENT '校区学科维度表'
    ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
    STORED AS ORC TBLPROPERTIES ('orc.compress' = 'SNAPPY')
"